//参考jd登录页
var Util = {
	Cookie : {
		set : function(name, value, expire) {
			var exp = new Date();
			exp.setTime(exp.getTime() + expire * 24 * 60 * 60 * 1000);
			document.cookie = name + "=" + encodeURIComponent(value, "UTF-8")
					+ ";expires=" + exp.toGMTString()
					+ ";domain=passport.jd.com;path=/";
		},
		get : function(key) {
			var cookies = document.cookie ? document.cookie.split('; ') : [];
			for (var i = 0, l = cookies.length; i < l; i++) {
				var parts = cookies[i].split('=');
				var name = parts.shift();
				var cookie = parts.join('=');
				if (key && key === name) {
					return cookie;
				}
			}
		},
		setALCookie : function() {// 记住密码
			if ($("input[name='chkRememberMe']").prop("checked")) {
				var Days = 3 * 30;
				this.set("alpin", $("#loginname").val(), Days);
			} else {
				var v = this.get("alpin");
				if (v) {
					this.set("alpin", "", -100);
				}
			}
		}
	},
	Header : {
		getProtocol : function() {
			var parentScheme = '';
			try {
				parentScheme = parent.location.protocol;
			} catch (e) {
				parentScheme = LoginConstant.HTTP_SCHEME;
			}
			if (!parentScheme) {
				parentScheme = LoginConstant.HTTP_SCHEME;
			}
			return parentScheme;
		}
	}
};

(function($) {

});
